# -*- coding:utf-8
"""
作者: Jia
日期: 2022年04月17日
描述: https://leetcode-cn.com/problems/contains-duplicate/
"""
from typing import List


class Solution:
    def containsDuplicateI(self, nums: List[int]) -> bool:
        d = dict()
        for num in nums:
            if num in d:
                return True
            d[num] = 1
        return False

    def containsDuplicate(self, nums: List[int]) -> bool:
        return len(nums) != len(set(nums))
